package com.situ.blog.service.impl;

import com.situ.blog.dao.IAdminDao;
import com.situ.blog.dao.IAuthDao;
import com.situ.blog.dao.impl.AdminDao;
import com.situ.blog.pojo.Admin;
import com.situ.blog.pojo.Auth;
import com.situ.blog.pojo.query.AdminQuery;
import com.situ.blog.service.IAdminService;
import com.situ.blog.util.PageRusult;

import java.util.List;

public class AdminserviceImpl implements IAdminService {
    IAdminDao adminDao = new AdminDao();
    @Override
    public PageRusult<Admin> selectByPage(AdminQuery adminQuery) {
        List<Admin> list = adminDao.selectByPage(adminQuery);
        int totalCount = adminDao.totalCount(adminQuery);
        PageRusult<Admin> pageRusult = new PageRusult(0,"",totalCount,list);
        return pageRusult;
    }

    @Override
    public void add(Admin admin) {

    }

    @Override
    public int deleteById(int id) {
        return 0;
    }

    @Override
    public Admin selectById(String id) {
        return null;
    }

    @Override
    public void updateStatus(String id, int status) {

    }

    @Override
    public void update(Admin admin) {

    }

    @Override
    public void deleteAll(String[] ids) {

    }
    
    public Admin login(String name, String password) {
        Admin admin = adminDao.login(name,password);
        return admin;
    }


}
